'use strict';
/**
 * template config
 */
export default {
  type: 'nunjucks',
  content_type: 'text/html',
  file_ext: '.html',
  file_depr: '/',
  root_path: think.ROOT_PATH + '/view',
  adapter: {
    nunjucks: {
      prerender: (nunjucks, env) => {

        /**
       * 时间戳格式化 dateformat('Y-m-d H:i:s')
       * @param extra 'Y-m-d H:i:s'
       * @param date  时间戳
       * @return  '2015-12-17 15:39:44'
       */
        env.addFilter("dateformat", function (extra, date) {
          return dateformat(date, extra);
        }),
        env.addFilter("timeformat", function (date) {
          return timeformat(date);
        }),
        env.addFilter("htmldecode", function (data) {
          return htmldecode(data);
        })
      }
    }
  }

};